home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-02 / fgl110c.zip / 09-04.C < prev    next >
Text File  |  1992-01-31  |  525b  |  32 lines

  1. #include <fastgraf.h>
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4.  
  5. void main(void);
  6.  
  7. char triangle[] = {
  8.    0xFF,0x80, 0x7F,0x00, 0x3E,0x00,
  9.    0x1C,0x00, 0x08,0x00
  10.    };
  11.  
  12. void main()
  13. {
  14.    int old_mode;
  15.  
  16.    if (fg_testmode(6,1) == 0) {
  17.       printf("This program requires a ");
  18.       printf("CGA graphics mode.\n");
  19.       exit(1);
  20.       }
  21.  
  22.    old_mode = fg_getmode();
  23.    fg_setmode(6);
  24.  
  25.    fg_move(316,101);
  26.    fg_drwimage(triangle,2,5);
  27.    fg_waitkey();
  28.  
  29.    fg_setmode(old_mode);
  30.    fg_reset();
  31. }
  32.